#! /usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2020/11/4 22:57
# @Author : youngchaolin

# 使用
# from clyang import name
# from clyang import read1
# from clyang import read2
#
# print(name)
# read1()
# read2()

# 但是容易产生名字冲突
name = 'alex'
# from clyang import name 导入后，打印成clyang
print(name)

# def read1():
#     print('我是本地read1方法')
#
# read1()
#
# from clyang import read1
# read1()

name = 'alex'
# read1() # 我以为是打印alex，没想到是'clyang模块：clyang'
'''
以上read1()方法执行后，执行的还是clyang模块中的read1方法，read1方法打印的name
是clyang模块中的name，不是这个调用模块中name
'''

# print('----change方法测试----')
# from clyang import change
# name='alex'
# print(name) # alex
# change() # messi
# print(name) # alex
# from clyang import name
# print(name) # messi

# print('----import *----')
# from clyang import *
# print(name)
# read1()
# read2() # 报错'NameError: name 'read2' is not defined'

# 判断__name__是否等于__main__，导入clyang后，不会执行模块里的方法
import clyang

# 查看内置模块
import sys

# print(sys.modules)

print(sys.path)
